<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>外卖网-修改信息</title>
<link href="style/css.css" rel="stylesheet" type="text/css">
<script src="js/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="js/My97DatePicker/WdatePicker.js"
      type="text/javascript"></script> 
<script src="js/jquery.blockUI.js" type="text/javascript"></script>
<script type="text/javascript"> 
$(document).ready(function(){


  var riqinian=$("#riqiNian").val();
  var riqiyue=$("#riqiYue").val();
$.ajax({ 
    type:'post', //传送的方式,get/post 
    url:'getAllShopMarketing.php', //发送数据的地址 
    cache:'false', 
    data:'riqinian='+riqinian+"&riqiyue="+riqiyue, 
    dataType: 'text',
    success:function(data) 
    { 
      var hi=data.split(",");
      $("#fenshu").html(hi[1]);
      $("#jiage").html(hi[0]);
    }
  }) 





});

function getAllOrderMoney(sid){


  var riqinian=$("#riqiNian").val();
  var riqiyue=$("#riqiYue").val();
$.ajax({ 
    type:'post', //传送的方式,get/post 
    url:'getAllShopMarketing.php', //发送数据的地址 
    cache:'false', 
    data:'riqinian='+riqinian+"&riqiyue="+riqiyue+"&sid="+sid, 
    dataType: 'text',
    success:function(data) 
    { 
      var hi=data.split(",");
      $("#fenshu").html(hi[1]);
      $("#jiage").html(hi[0]);
    }
  }) 



}




$(function(){ 
//Default Action 
$(".tab_content").hide(); //Hide all content 
$("ul.tabs li:first").addClass("active").show(); //Activate first tab 
$(".tab_content:first").show(); //Show first tab content 
//On Click Event 
$("ul.tabs li").click(function() { 
$("ul.tabs li").removeClass("active"); //Remove any "active" class 
$(this).addClass("active"); //Add "active" class to selected tab 
$(".tab_content").hide(); //Hide all tab content 
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content 
$(activeTab).fadeIn(); //Fade in the active content 
return false; 
}); 
}); 
</script> 
<script type="text/javascript"> 
$(function(){
$('#login').click(function(){   //给box_btn绑定一个鼠标点击的事件
$.blockUI({    //当点击事件发生时调用弹出层
  message: $('#loginbox'),    //要弹出的元素box
  css: {    //弹出元素的CSS属性
    border:'5px solid #334343',
    textAlign: 'left',
	width: '490px',
	top:  ($(window).height() - 290) /2 + 'px', 
    left: ($(window).width() - 490) /2 + 'px', 
	cursor: 'auto'
       },
  overlayCSS: {
	opacity: '0.7' 
	          }
         });
$('.blockOverlay').attr('title','单击关闭').click($.unblockUI);   //遮罩层属性的设置以及当鼠标单击遮罩层可以关闭弹出层
$('.close').click($.unblockUI);  //也可以自定义一个关闭按钮来关闭弹出层

});

$('#shoplogin').click(function(){   //给box_btn绑定一个鼠标点击的事件
  $.blockUI({    //当点击事件发生时调用弹出层
    message: $('#loginbox'),    //要弹出的元素box
    css: {    //弹出元素的CSS属性
      border:'5px solid #334343',
      textAlign: 'left',
    width: '490px',
    top:  ($(window).height() - 290) /2 + 'px', 
      left: ($(window).width() - 490) /2 + 'px', 
    cursor: 'auto'
         },
    overlayCSS: {
    opacity: '0.7' 
              }
   });
  $('.blockOverlay').attr('title','单击关闭').click($.unblockUI);   //遮罩层属性的设置以及当鼠标单击遮罩层可以关闭弹出层
  $('.close').click($.unblockUI);  //也可以自定义一个关闭按钮来关闭弹出层
  $("#alllogin").attr("action","login-shop.php");
  });

});
</script> 

<?php
//包含数据库连接文件
//session_start();
include('system/db/conn.php');
$supplierid=$_SESSION['supplierid'];  
$local_array = mysql_query("select * from do_supplier_location where supplier_id=$supplierid");
$row = mysql_fetch_row($local_array);
mysql_free_result($local_array);

$hello = explode('-',$row[9]); 

?> 
</head>

<body>

<div id="loginbox" style="display:none">
  <div class="login_title">会员登录</div>
  <div class="login_input">
    <div class="input"><span>账号：</span><span><input name="user" type="text" /></span></div>
    <div class="input"><span>密码：</span><span><input name="pwd" type="password" /></span></div>
    <div class="login_input_1 clearfix"><input name="" type="checkbox" value="" id="store1" /><label for="store1">自动登录</label><a href="#">找回密码</a></div>
    <div class="reg clearfix"><span><input class="login_btn" name="" type="image" src="images/login.jpg" /></span><span>还没有账号？</span><a href="#">立即注册</a></div>
  </div>
</div>

<div class="top">
  <div class="top_content clearfix"><span class="left"><a href="index.php"><img src="images/wmwlogo.png"></a></span><span class="right">
 
  <?php
    if(isset($_SESSION['username'])){
      if($_SESSION['logintype']=="userlog"){
     echo '<a href="member.php">'.$_SESSION['username'],'欢迎你！</a>';
}elseif ($_SESSION['logintype']=="supplierlog") {
   echo '<a href="shop-xx.php">'.$_SESSION['username'],'欢迎你！</a>';
}
      echo '<a href="login.php?action=logout">登出</a>';
    }else{
      echo ' <a href="#" id="login">';
      echo '登录';
      echo '</a> / <a href="reg11.php">注册</a>';
    }
  ?>
  <?php  
      if(!isset($_SESSION['username'])  ){
   ?>
  | <a href="#"  id="shoplogin">店铺登录</a></span></div>
  <?php 
    }

   ?>
</div>  

<div class="content clearfix">
  <div class="content_con clearfix">
    <div class="box_left left">
      <div class="box">
        <div class="box_title">
          <div class="box_title_con1 left">
            <?php echo $_SESSION['username'] ?>
          </div>
          
        </div>
        <ul class="clearfix box_ul">
          <li class="liselect"><span class="ico5select"><a href="shop-xx.php">店铺信息</a></span></li>
          <li><span class="ico6"><a href="shop-dd.php">订单管理</a></span></li>
          <li><span class="ico7"><a href="shop-cd.php">菜单管理</a></span></li>
          <li><span class="ico4"><a href="shop-pass.php">修改密码</a></span></li>
        </ul>
      </div>
      <div class="box">
        <div class="box_title"><div class="box_title"><div class="box_title_title">销售统计</div></div></div>
        <ul class="clearfix box_ul_1">
          <li> 
            <span>日期</span>
            <span>
              <input type="text" name="open_time2" id="riqiNian" onchange="getAllOrderMoney(<?php echo $_SESSION['supplierid'] ?>)" value="<?php echo date("Y") ?>"  style="width:78px;height:23px;" size="20" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy'})">年
              
            </span>
            <span>
              <input type="text" name="open_time2"  id="riqiYue" onchange="getAllOrderMoney(<?php echo $_SESSION['supplierid'] ?>)" value="<?php echo date("m") ?>" style="width:22px;height:23px;" size="20" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'MM'})">月
              
            </span>
          </li>
          <li><span class="count_tit">单量</span><span id="fenshu">0</span>份</li>
          <li><span class="count_tit">销售额</span><span id="jiage">0</span>元</li>
          
        </ul>
      </div>
    </div>
    <div class="box_right right">
      <div class="box" style="height:600px;">
        <div class="box_title"><div class="box_title_title">修改信息</div></div>
        <form name="reWriteShopInfo" method="post" action="reWriteShopInfo.php" >
        <div class="box_content">
          <div class="input_list clearfix" style="margin-top:20px;">
            <div class="tit">起送价钱</div>
            <div class="left"><input type="text" name="takeaway_price" class="shopinfo_1" value="<?php echo  round($row[75],1) ?>"></div>
            <div style="font-size:12px;color:#000;margin-left:5px;float:left;">元</div>
          </div>
          <div class="input_list clearfix">
            <div class="tit">地址</div>
            <div class="left"><input type="text" name="address" value="<?php echo $row[3] ?>"></div>
          </div>
          <div class="input_list clearfix">
            <div class="tit">营业时间</div>
            <div class="left">
              
              <input type="text" name="open_time1" value="<?php echo $hello[0] ?>" style="width:73px;height:23px;" size="20" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'HH:mm'})">
            </div>
            <span class="left"><b>至</b></span>
            <div class="left">
              <input type="text" name="open_time2" value="<?php  echo $hello[1] ?>" style="width:78px;height:23px;" size="20" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'HH:mm'})">
            </div>
          </div>
          <div class="input_list clearfix">
            <div class="tit">电话</div>
            <div class="left"><input type="text" name="takeaway_tel"  value="<?php echo $row[80] ?>"></div>
          </div>
          <div class="input_list clearfix">
            <div class="tit">公告</div>
            <div class="left">
              <textarea class="shopinfo_2" name="contact"><?php echo $row[5] ?></textarea>
            </div>
          </div>
          <div style="display:none;" class="input_list clearfix">
            <div class="tit">送餐限时</div>
            <div class="left">
              <select  id="year2">
                <option value="2013年" selected="selected">2013年</option>
                <option value="2014年" >2014年</option>
                <option value="2015年" >2015年</option>
                <option value="2016年" >2016年</option>
              </select>

            </div>
          </div>
          <div class="edit_btn clearfix">
          <input type="image" src="images/save1.jpg" name="submit">
        </div>
        </form>
        </div>
      </div>
    </div>
  </div>
</div>

<?php include('bottom.php') ?>
</body>
</html>
